<template>
  <el-dialog
    title="查看消息"
    :visible.sync="dialogVisible"
    :before-close="close"
    :close-on-click-modal="false"
    :append-to-body="true"
    class="vc-dialog-form append-to-body read-msg-dialog"
    width="500px">

    <div class="title text-ellipsis">{{ entity.title }}</div>
    <div class="info font-thead">
      <span class="type text-ellipsis">消息类型：{{ GLOBAL.formatter.formatTableCol(entity.type, 'xxlx') }}</span>
      <span class="time">创建时间：{{ GLOBAL.formatter.formatDateTime(entity.createTime, 'YYYY-MM-DD hh:mm:ss') }}</span>
    </div>
    <div class="content scrollbar">{{ entity.content }}</div>

    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="close">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'readMsg',
  props: ['dialogVisible', 'entity'],
  methods: {
    /**
     * 关闭
     */
    close () {
      this.$emit('close')
    }
  }
}
</script>

<style lang="less">
.read-msg-dialog {
  .el-dialog__body {
    padding: 20px !important;
  }
  .title {
    font-size: 18px;
    font-weight: bold;
    color: #545454;
  }
  .info {
    display: flex;
    justify-content: space-between;
    min-height: 40px;
    line-height: 40px;
    font-size: 12px;
    color: #A2A2A2;
    border-bottom: 1px dashed #DFE5EE;
    .type {
      max-width: calc(100% - 200px);
      margin-right: 30px;
    }
  }
  .content {
    min-height: 100px;
    max-height: 200px;
    line-height: 26px;
    margin-top: 10px;
    font-size: 14px;
    color: #545454;
  }
}
</style>
